import { request } from 'umi';

/** 获取当前的用户 */
export async function currentUser(options?: Record<string, any>) {
  return request<{
    data: USER.CurrentUser;
  }>('/api/currentUser', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 退出登录接口 */
export async function outLogin(options?: Record<string, any>) {
  return request<Record<string, any>>('/api/login/outLogin', {
    method: 'POST',
    ...(options || {}),
  });
}

/** 登录接口  */
export async function login(data: USER.LoginParams, options?: Record<string, any>) {
  return request<Record<string, any>>('/api/login/account', {
    method: 'POST',
    data,
    ...(options || {}),
  });
}
